const ROOT_PATH = require('app-root-path').path; //项目根路径
const path = require('path');
const dbUtil = require(path.join(ROOT_PATH, "/lib/db_util"));
const userServe = {
	test: async function () {
		const sql = "select * from user;";
		let data = await dbUtil.queryAll(sql);
		return {
			code: 200,
			result: data,
		};
	},
	person: async function () {
		const sql = "select * from person where age <= 100;";
		let data = await dbUtil.queryOne(sql);
		return {
			code: 200,
			result: data,
		};
	}
}

module.exports = userServe;


